﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;

namespace Epona.AOP.Cache
{
    public interface ICacheRepository
    {
        bool Insert(string key, object o, TimeSpan? expire = null);

        bool Insert<T>(string key, T t, TimeSpan? expire = null);

        bool Delete(string key);
        bool Update(string key, object o, TimeSpan? expire = null);

        bool Update<T>(string key, T t, TimeSpan? expire = null);

        IQueryable<object> GetAll();

        IList<string> GetKeys(string pattern);

        object Get(string key);

        T Get<T>(string key) where T : class;

        bool IsExist(string key);

        bool ReSetExpire(string key, TimeSpan expire);

        TimeSpan GetTimeToLive(string key);

        IDictionary<string, T> GetList<T>(ICollection<string> keys);

        void FlushAll();
    }
}
